package com.zr.model;
// Generated 2017-7-3 20:01:15 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Cargostatus generated by hbm2java
 */
@Entity
@Table(name = "cargostatus", catalog = "lms")
public class Cargostatus implements java.io.Serializable {

	private Integer csId;
	private Packagebag packagebag;
	private Driver driver;
	private Order order;
	private String csCurrentLocation;
	private String csNextLocation;
	private String csCurrentDate;
	private Set<Order> orders = new HashSet<Order>(0);

	public Cargostatus() {
	}

	public Cargostatus(Packagebag packagebag, Driver driver, Order order, String csCurrentLocation,
			String csNextLocation, String csCurrentDate, Set<Order> orders) {
		this.packagebag = packagebag;
		this.driver = driver;
		this.order = order;
		this.csCurrentLocation = csCurrentLocation;
		this.csNextLocation = csNextLocation;
		this.csCurrentDate = csCurrentDate;
		this.orders = orders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "csId", unique = true, nullable = false)
	public Integer getCsId() {
		return this.csId;
	}

	public void setCsId(Integer csId) {
		this.csId = csId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "packageId")
	public Packagebag getPackagebag() {
		return this.packagebag;
	}

	public void setPackagebag(Packagebag packagebag) {
		this.packagebag = packagebag;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "driverId")
	public Driver getDriver() {
		return this.driver;
	}

	public void setDriver(Driver driver) {
		this.driver = driver;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "orId")
	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	@Column(name = "csCurrentLocation")
	public String getCsCurrentLocation() {
		return this.csCurrentLocation;
	}

	public void setCsCurrentLocation(String csCurrentLocation) {
		this.csCurrentLocation = csCurrentLocation;
	}

	@Column(name = "csNextLocation")
	public String getCsNextLocation() {
		return this.csNextLocation;
	}

	public void setCsNextLocation(String csNextLocation) {
		this.csNextLocation = csNextLocation;
	}

	@Column(name = "csCurrentDate")
	public String getCsCurrentDate() {
		return this.csCurrentDate;
	}

	public void setCsCurrentDate(String csCurrentDate) {
		this.csCurrentDate = csCurrentDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cargostatus")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

}
